package Demo21;

import java.io.IOException;
import java.io.InputStream;
import java.net.Socket;
import java.net.UnknownHostException;

public class MySocket {
    //客户端
    public static void main(String[] args) throws IOException {
//        try {
            Socket so=new Socket("172.20.87.232",8888);
//        } catch (IOException e) {
//            e.printStackTrace();
//        }
        System.out.println("连接到报务器……");
        InputStream is =so.getInputStream();
        int n=-1;
        byte[] bs=new  byte[1024];
        while ((n=is.read(bs))!=-1){
            System.out.println(new String(bs,0,n));
        }
        is.close();
    }
}
